﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private bool Test;
        private String pheptinh, LastValue;

        private void buttonClear_Click(object sender, EventArgs e)
        {
            textBox1.Clear();
        }

        private void chislo1_Click(object sender, EventArgs e)
        {
            if (Test) textBox1.Clear();
            textBox1.Text = textBox1.Text + "1";
            Test = false;
        }

        private void chislo2_Click(object sender, EventArgs e)
        {
            if (Test) textBox1.Clear();
            textBox1.Text = textBox1.Text + "2";
            Test = false;
        }

        private void chislo3_Click(object sender, EventArgs e)
        {
            if (Test) textBox1.Clear();
            textBox1.Text = textBox1.Text + "3";
            Test = false;
        }

        private void chislo4_Click(object sender, EventArgs e)
        {
            if (Test) textBox1.Clear();
            textBox1.Text = textBox1.Text + "4";
            Test = false;
        }

        private void chislo5_Click(object sender, EventArgs e)
        {
            if (Test) textBox1.Clear();
            textBox1.Text = textBox1.Text + "5";
            Test = false;
        }

        private void chislo6_Click(object sender, EventArgs e)
        {
            if (Test) textBox1.Clear();
            textBox1.Text = textBox1.Text + "6";
            Test = false;
        }

        private void chislo7_Click(object sender, EventArgs e)
        {
            if (Test) textBox1.Clear();
            textBox1.Text = textBox1.Text + "7";
            Test = false;
        }

        private void chislo8_Click(object sender, EventArgs e)
        {
            if (Test) textBox1.Clear();
            textBox1.Text = textBox1.Text + "8";
            Test = false;
        }

        private void chislo9_Click(object sender, EventArgs e)
        {
            if (Test) textBox1.Clear();
            textBox1.Text = textBox1.Text + "9";
            Test = false;
        }

        private void chislo0_Click(object sender, EventArgs e)
        {
            if (Test) textBox1.Clear();
            textBox1.Text = textBox1.Text + "0";
            Test = false;
        }

        private void Chislo_i_Click(object sender, EventArgs e)
        {
            if (Test) textBox1.Clear();
            textBox1.Text = textBox1.Text + "e";
            Test = false;
        }

        private void Kvadrat_Click(object sender, EventArgs e)
        {
            if (Test) textBox1.Clear();
            textBox1.Text = textBox1.Text + "^2";
            Test = false;
        }

        private void ZnakPlus_Click(object sender, EventArgs e)
        {
            if (Test) textBox1.Clear();
            textBox1.Text = textBox1.Text + "+";
            Test = false;
        }

        private void ZnakMinus_Click(object sender, EventArgs e)
        {
            if (Test) textBox1.Clear();
            textBox1.Text = textBox1.Text + "-";
            Test = false;
        }

        private void ZnakUmnozit_Click(object sender, EventArgs e)
        {
            if (Test) textBox1.Clear();
            textBox1.Text = textBox1.Text + "*";
            Test = false;
        }

        private void Factorial_Click(object sender, EventArgs e)
        {
            if (Test) textBox1.Clear();
            textBox1.Text = textBox1.Text + "!";
            Test = false;
        }

        private void Sqrt_Click(object sender, EventArgs e)
        {
            if (Test) textBox1.Clear();
            textBox1.Text = textBox1.Text + "sqrt";
            Test = false;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Form frm = new Form2();
            frm.Show();
        }



    }
}
